/**
 * 注册控制处理器
 */
angular.module('proframe.Register',[])
    .controller('RegisterController', ['$scope', '$rootScope', '$location','$http','ConstantBox','ProframeService', registerController]);

function registerController($scope, $rootScope, $location,$http,ConstantBox,ProframeService){
    var register = this;
    register.error = "";
    register.register = function(){
        //TODO 处理注册信息
        var postData = $("#registerform").serializeArray();
        ProframeService.jsonpPost('/user/doregister',postData).then(function(result){
            console.log(result);
            register.error = result.msg;
            if(result.code=='00'){
                //注册成功 跳转到登录页面
                $location.path('/login');
            }else{

            }


        });
    }
}